package com.ruoyi.group.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.group.domain.GoodsAndStore;
import com.ruoyi.group.domain.StockBill;
import com.ruoyi.group.domain.StockBillItem;
import org.apache.ibatis.annotations.Param;

/**
 * 出入库单据Mapper接口
 *
 * @author Zzz
 * @date 2022-11-28
 */
public interface StockBillMapper extends BaseMapper<StockBill> {

    /**
     * 查询出入库单据列表
     *
     * @param stockBill 出入库单据
     * @return 出入库单据集合
     */
    public List<StockBill> selectStockBillList(StockBill stockBill);

    void saveItem(StockBillItem stockBillItem);

    void saveRelation(@Param("goodsId") String goodsId, @Param("storeId") String storeId, @Param("count") Integer count);

    List<StockBillItem> selectMoneyAndCount(Long id);

    GoodsAndStore selectRelation(@Param("goodsId") String goodsId, @Param("storeId") String storeId);

    void updateRelation(@Param("id")Long id,@Param("count") Integer count);

    int selectStoreCount(@Param("storeId") String storeId,@Param("goodsId")String goodsId);

    void removeRelation(@Param("id")Long id,@Param("count") Integer count);

    int selectItemCount(@Param("id") Long id,@Param("goodsId")String goodsId);

    Integer selectJudge(@Param("storeId") String storeId,@Param("goodsId") String goodsId);
}
